﻿<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  <xsl:output method="text" omit-xml-declaration="yes" indent="no" encoding="utf-8" />

<xsl:template match="/">

  <xsl:apply-templates select="TypeDifference" />

</xsl:template>

<xsl:template match="TypeDifference">

<xsl:value-of select="@Name" />
=============================
  
<xsl:value-of select="@NamespaceName" />
----------------------------------------  

<xsl:call-template name="navigation" />

<!-- Top level changes -->

<xsl:apply-templates select="TypeTaxonomy" />
<xsl:apply-templates select="InheritanceChanged" />

<!-- Removed -->
<xsl:apply-templates select="ConstantsRemoved" />
<xsl:apply-templates select="FieldsRemoved" />
<xsl:apply-templates select="ConstructorsRemoved" />
<xsl:apply-templates select="FinalizersRemoved" />
<xsl:apply-templates select="EventsRemoved" />
<xsl:apply-templates select="PropertiesRemoved" />
<xsl:apply-templates select="IndexersRemoved" />
<xsl:apply-templates select="MethodsRemoved" />
<xsl:apply-templates select="ValuesRemoved" />

<!-- Obsolete -->
<xsl:apply-templates select="ConstantsObsolete" />
<xsl:apply-templates select="FieldsObsolete" />
<xsl:apply-templates select="ConstructorsObsolete" />
<xsl:apply-templates select="EventsObsolete" />
<xsl:apply-templates select="PropertiesObsolete" />
<xsl:apply-templates select="IndexersObsolete" />
<xsl:apply-templates select="MethodsObsolete" />

<!-- Changed -->
<xsl:apply-templates select="ConstantsChanged" />
<xsl:apply-templates select="FieldsChanged" />
<xsl:apply-templates select="ConstructorsChanged" />
<xsl:apply-templates select="EventsChanged" />
<xsl:apply-templates select="PropertiesChanged" />
<xsl:apply-templates select="IndexersChanged" />
<xsl:apply-templates select="MethodsChanged" />

<!-- Added -->
<xsl:apply-templates select="ConstantsAdded" />
<xsl:apply-templates select="FieldsAdded" />
<xsl:apply-templates select="ConstructorsAdded" />
<xsl:apply-templates select="FinalizersAdded" />
<xsl:apply-templates select="EventsAdded" />
<xsl:apply-templates select="PropertiesAdded" />
<xsl:apply-templates select="IndexersAdded" />
<xsl:apply-templates select="MethodsAdded" />
<xsl:apply-templates select="ValuesAdded" />

<!-- TODO:Finalizers -->

<!-- TODO:Delegates -->

<xsl:call-template name="navigation" />

Generated by [<xsl:value-of select="@ProductName" /> version <xsl:value-of select="@ProductVersion" />](<xsl:value-of select="@ProductLink" />)

</xsl:template>


<!-- Top level changes -->

<xsl:template match="TypeTaxonomy">

<xsl:call-template name="write_2column_article">
<xsl:with-param name="title" select="'General Changes'" />
<xsl:with-param name="caption" select="'General Changes'" />
<xsl:with-param name="column1" select="'Change'" />
<xsl:with-param name="column2" select="'Message'" />
</xsl:call-template>

</xsl:template>

<xsl:template match="InheritanceChanged">

<xsl:call-template name="write_3column_article">
<xsl:with-param name="title" select="'Inheritance Changes'" />
<xsl:with-param name="caption" select="'Changes to inheritance hierarchy'" />
<xsl:with-param name="column1" select="'Was'" />
<xsl:with-param name="column2" select="'Is'" />
<xsl:with-param name="column3" select="'Description'" />
</xsl:call-template>

</xsl:template>

<!-- See below -->

<xsl:template match="TypeInheritanceChange">

<xsl:if test="not(@To = '')">
| Base type changed from <xsl:value-of select="@From" /> to <xsl:value-of select="@To" /> |
</xsl:if>

<xsl:if test="@To = ''">
| No longer derived from <xsl:value-of select="@From" /> |
</xsl:if>

</xsl:template>

<!-- Removed -->
<xsl:template match="ConstantsRemoved">

<xsl:call-template name="write_2column_article">
<xsl:with-param name="title" select="'Removed Constants'" />
<xsl:with-param name="caption" select="'Removed Constants'" />
<xsl:with-param name="column1" select="'Constant'" />
<xsl:with-param name="column2" select="'Message'" />
</xsl:call-template>

</xsl:template>

<xsl:template match="FieldsRemoved">

<xsl:call-template name="write_2column_article">
<xsl:with-param name="title" select="'Removed Fields'" />
<xsl:with-param name="caption" select="'Removed Fields'" />
<xsl:with-param name="column1" select="'Field'" />
<xsl:with-param name="column2" select="'Message'" />
</xsl:call-template>

</xsl:template>

<xsl:template match="ConstructorsRemoved">

<xsl:call-template name="write_2column_article">
<xsl:with-param name="title" select="'Removed Constructors'" />
<xsl:with-param name="caption" select="'Removed Constructors'" />
<xsl:with-param name="column1" select="'Signature'" />
<xsl:with-param name="column2" select="'Message'" />
</xsl:call-template>

</xsl:template>

<xsl:template match="FinalizersRemoved">

<xsl:call-template name="write_2column_article">
<xsl:with-param name="title" select="'Removed Finalizer'" />
<xsl:with-param name="caption" select="'Removed Finalizer'" />
<xsl:with-param name="column1" select="'Signature'" />
<xsl:with-param name="column2" select="'Message'" />
</xsl:call-template>

</xsl:template>

<xsl:template match="EventsRemoved">

<xsl:call-template name="write_2column_article">
<xsl:with-param name="title" select="'Removed Events'" />
<xsl:with-param name="caption" select="'Removed Events'" />
<xsl:with-param name="column1" select="'Event'" />
<xsl:with-param name="column2" select="'Message'" />
</xsl:call-template>

</xsl:template>

<xsl:template match="PropertiesRemoved">

<xsl:call-template name="write_2column_article">
<xsl:with-param name="title" select="'Removed Properties'" />
<xsl:with-param name="caption" select="'Removed Properties'" />
<xsl:with-param name="column1" select="'Property'" />
<xsl:with-param name="column2" select="'Message'" />
</xsl:call-template>

</xsl:template>

<xsl:template match="IndexersRemoved">

<xsl:call-template name="write_2column_article">
<xsl:with-param name="title" select="'Removed Indexers'" />
<xsl:with-param name="caption" select="'Removed Indexers'" />
<xsl:with-param name="column1" select="'Signature'" />
<xsl:with-param name="column2" select="'Message'" />
</xsl:call-template>

</xsl:template>

<xsl:template match="MethodsRemoved">

<xsl:call-template name="write_2column_article">
<xsl:with-param name="title" select="'Removed Methods'" />
<xsl:with-param name="caption" select="'Removed Methods'" />
<xsl:with-param name="column1" select="'Signature'" />
<xsl:with-param name="column2" select="'Message'" />
</xsl:call-template>

</xsl:template>

<xsl:template match="ValuesRemoved">

<xsl:call-template name="write_2column_article">
<xsl:with-param name="title" select="'Removed Enum Values'" />
<xsl:with-param name="caption" select="'Removed Enum Values'" />
<xsl:with-param name="column1" select="'Value'" />
<xsl:with-param name="column2" select="'Message'" />
</xsl:call-template>

</xsl:template>


<!-- Obsolete -->
<xsl:template match="ConstantsObsolete">

<xsl:call-template name="write_2column_article">
<xsl:with-param name="title" select="'Obsolete Constants'" />
<xsl:with-param name="caption" select="'Obsolete Constants'" />
<xsl:with-param name="column1" select="'Constant'" />
<xsl:with-param name="column2" select="'Message'" />
</xsl:call-template>

</xsl:template>

<xsl:template match="FieldsObsolete">

<xsl:call-template name="write_2column_article">
<xsl:with-param name="title" select="'Obsolete Fields'" />
<xsl:with-param name="caption" select="'Obsolete Fields'" />
<xsl:with-param name="column1" select="'Field'" />
<xsl:with-param name="column2" select="'Message'" />
</xsl:call-template>

</xsl:template>

<xsl:template match="ConstructorsObsolete">

<xsl:call-template name="write_2column_article">
<xsl:with-param name="title" select="'Obsolete Constructors'" />
<xsl:with-param name="caption" select="'Obsolete Constructors'" />
<xsl:with-param name="column1" select="'Signature'" />
<xsl:with-param name="column2" select="'Message'" />
</xsl:call-template>

</xsl:template>

<xsl:template match="EventsObsolete">

<xsl:call-template name="write_2column_article">
<xsl:with-param name="title" select="'Obsolete Events'" />
<xsl:with-param name="caption" select="'Obsolete Events'" />
<xsl:with-param name="column1" select="'Event'" />
<xsl:with-param name="column2" select="'Message'" />
</xsl:call-template>

</xsl:template>

<xsl:template match="PropertiesObsolete">

<xsl:call-template name="write_2column_article">
<xsl:with-param name="title" select="'Obsolete Properties'" />
<xsl:with-param name="caption" select="'Obsolete Properties'" />
<xsl:with-param name="column1" select="'Property'" />
<xsl:with-param name="column2" select="'Message'" />
</xsl:call-template>

</xsl:template>

<xsl:template match="IndexersObsolete">

<xsl:call-template name="write_2column_article">
<xsl:with-param name="title" select="'Obsolete Indexers'" />
<xsl:with-param name="caption" select="'Obsolete Indexers'" />
<xsl:with-param name="column1" select="'Signature'" />
<xsl:with-param name="column2" select="'Message'" />
</xsl:call-template>

</xsl:template>

<xsl:template match="MethodsObsolete">

<xsl:call-template name="write_2column_article">
<xsl:with-param name="title" select="'Obsolete Methods'" />
<xsl:with-param name="caption" select="'Obsolete Methods'" />
<xsl:with-param name="column1" select="'Signature'" />
<xsl:with-param name="column2" select="'Message'" />
</xsl:call-template>

</xsl:template>


<!-- Changed -->
<xsl:template match="ConstantsChanged">

<xsl:call-template name="write_3column_article">
<xsl:with-param name="title" select="'Changed Constants'" />
<xsl:with-param name="caption" select="'Changed Constants'" />
<xsl:with-param name="column1" select="'Was'" />
<xsl:with-param name="column2" select="'Is Now'" />
<xsl:with-param name="column3" select="'Message'" />
</xsl:call-template>

</xsl:template>

<xsl:template match="FieldsChanged">

<xsl:call-template name="write_3column_article">
<xsl:with-param name="title" select="'Changed Fields'" />
<xsl:with-param name="caption" select="'Changed Fields'" />
<xsl:with-param name="column1" select="'Was'" />
<xsl:with-param name="column2" select="'Is Now'" />
<xsl:with-param name="column3" select="'Message'" />
</xsl:call-template>

</xsl:template>

<xsl:template match="ConstructorsChanged">

<xsl:call-template name="write_3column_article">
<xsl:with-param name="title" select="'Changed Constructors'" />
<xsl:with-param name="caption" select="'Changed Constructors'" />
<xsl:with-param name="column1" select="'Was'" />
<xsl:with-param name="column2" select="'Is Now'" />
<xsl:with-param name="column3" select="'Message'" />
</xsl:call-template>

</xsl:template>

<xsl:template match="EventsChanged">

<xsl:call-template name="write_3column_article">
<xsl:with-param name="title" select="'Changed Events'" />
<xsl:with-param name="caption" select="'Changed Events'" />
<xsl:with-param name="column1" select="'Was'" />
<xsl:with-param name="column2" select="'Is Now'" />
<xsl:with-param name="column3" select="'Message'" />
</xsl:call-template>

</xsl:template>

<xsl:template match="PropertiesChanged">

<xsl:call-template name="write_3column_article">
<xsl:with-param name="title" select="'Changed Properties'" />
<xsl:with-param name="caption" select="'Changed Properties'" />
<xsl:with-param name="column1" select="'Was'" />
<xsl:with-param name="column2" select="'Is Now'" />
<xsl:with-param name="column3" select="'Message'" />
</xsl:call-template>

</xsl:template>

<xsl:template match="IndexersChanged">

<xsl:call-template name="write_3column_article">
<xsl:with-param name="title" select="'Changed Indexers'" />
<xsl:with-param name="caption" select="'Changed Indexers'" />
<xsl:with-param name="column1" select="'Was'" />
<xsl:with-param name="column2" select="'Is Now'" />
<xsl:with-param name="column3" select="'Message'" />
</xsl:call-template>

</xsl:template>

<xsl:template match="MethodsChanged">

<xsl:call-template name="write_3column_article">
<xsl:with-param name="title" select="'Changed Methods'" />
<xsl:with-param name="caption" select="'Changed Methods'" />
<xsl:with-param name="column1" select="'Was'" />
<xsl:with-param name="column2" select="'Is Now'" />
<xsl:with-param name="column3" select="'Message'" />
</xsl:call-template>

</xsl:template>


<!-- Added -->
<xsl:template match="ConstantsAdded">

<xsl:call-template name="write_2column_article">
<xsl:with-param name="title" select="'Added Constants'" />
<xsl:with-param name="caption" select="'New Constants'" />
<xsl:with-param name="column1" select="'Constant'" />
<xsl:with-param name="column2" select="'Message'" />
</xsl:call-template>

</xsl:template>

<xsl:template match="FieldsAdded">

<xsl:call-template name="write_2column_article">
<xsl:with-param name="title" select="'Added Fields'" />
<xsl:with-param name="caption" select="'New Fields'" />
<xsl:with-param name="column1" select="'Field'" />
<xsl:with-param name="column2" select="'Message'" />
</xsl:call-template>

</xsl:template>

<xsl:template match="ConstructorsAdded">

<xsl:call-template name="write_2column_article">
<xsl:with-param name="title" select="'Added Constructors'" />
<xsl:with-param name="caption" select="'New Constructors'" />
<xsl:with-param name="column1" select="'Signature'" />
<xsl:with-param name="column2" select="'Message'" />
</xsl:call-template>

</xsl:template>

<xsl:template match="FinalizersAdded">

<xsl:call-template name="write_2column_article">
<xsl:with-param name="title" select="'Added Finalizer'" />
<xsl:with-param name="caption" select="'New Finalizer'" />
<xsl:with-param name="column1" select="'Signature'" />
<xsl:with-param name="column2" select="'Message'" />
</xsl:call-template>

</xsl:template>

  <xsl:template match="EventsAdded">

<xsl:call-template name="write_2column_article">
<xsl:with-param name="title" select="'Added Events'" />
<xsl:with-param name="caption" select="'New Events'" />
<xsl:with-param name="column1" select="'Event'" />
<xsl:with-param name="column2" select="'Message'" />
</xsl:call-template>

</xsl:template>

<xsl:template match="PropertiesAdded">

<xsl:call-template name="write_2column_article">
<xsl:with-param name="title" select="'Added Properties'" />
<xsl:with-param name="caption" select="'New Properties'" />
<xsl:with-param name="column1" select="'Property'" />
<xsl:with-param name="column2" select="'Message'" />
</xsl:call-template>

</xsl:template>

<xsl:template match="IndexersAdded">

<xsl:call-template name="write_2column_article">
<xsl:with-param name="title" select="'Added Indexers'" />
<xsl:with-param name="caption" select="'New Indexers'" />
<xsl:with-param name="column1" select="'Signature'" />
<xsl:with-param name="column2" select="'Message'" />
</xsl:call-template>

</xsl:template>

<xsl:template match="MethodsAdded">

<xsl:call-template name="write_2column_article">
<xsl:with-param name="title" select="'Added Methods'" />
<xsl:with-param name="caption" select="'New Methods'" />
<xsl:with-param name="column1" select="'Signature'" />
<xsl:with-param name="column2" select="'Message'" />
</xsl:call-template>

</xsl:template>

<xsl:template match="ValuesAdded">

<xsl:call-template name="write_2column_article">
<xsl:with-param name="title" select="'Added Enum Values'" />
<xsl:with-param name="caption" select="'New Enum values'" />
<xsl:with-param name="column1" select="'Value'" />
<xsl:with-param name="column2" select="'Message'" />
</xsl:call-template>

</xsl:template>

<xsl:template name="write_2column_article" >
    <xsl:param name="title" />
    <xsl:param name="caption" />
    <xsl:param name="column1" />
    <xsl:param name="column2" />

<xsl:value-of select="$title" />
--------------------------------

| <xsl:value-of select="$column1" /> | <xsl:value-of select="$column2" /> |
| ---------------------------------- | ---------------------------------- |
<xsl:apply-templates />

</xsl:template>

<xsl:template name="write_3column_article" >
<xsl:param name="title" />
<xsl:param name="caption" />
<xsl:param name="column1" />
<xsl:param name="column2" />
<xsl:param name="column3" />

<xsl:value-of select="$title" />
--------------------------------

| <xsl:value-of select="$column1" /> | <xsl:value-of select="$column2" /> | <xsl:value-of select="$column3" /> |
| ------------------ | --------------- | ---------------------- |
<xsl:apply-templates />

</xsl:template>

<xsl:template match="UnaryTypeChange">
| <xsl:apply-templates select="Code" /> | <xsl:value-of select="Message" /> |
</xsl:template>

<xsl:template match="BinaryTypeChange">
| <xsl:apply-templates select="Was" /> | <xsl:apply-templates select="IsNow" /> | <xsl:apply-templates select="Message" /> | 
</xsl:template>

<xsl:template match="Code">
<xsl:apply-templates />
</xsl:template>

<xsl:template match="Was">
<xsl:apply-templates />
</xsl:template>

<xsl:template match="IsNow">
<xsl:apply-templates />
</xsl:template>

<xsl:template match="SourceCode">
<xsl:apply-templates />
</xsl:template>

<xsl:template match="punc">
<xsl:text disable-output-escaping="yes"> </xsl:text>
<xsl:value-of select="." />
<xsl:text disable-output-escaping="yes"> </xsl:text>
</xsl:template>

<xsl:template match="ident">
<xsl:value-of select="." />
</xsl:template>

<xsl:template match="kw">
<xsl:value-of select="." />
</xsl:template>

<xsl:template match="tn">
<xsl:value-of select="." />
</xsl:template>

<xsl:template name="navigation">

[Summary](<xsl:value-of select="@SummaryName" />.html)  
<xsl:text disable-output-escaping="yes">&gt;</xsl:text>
[<xsl:value-of select="@AssemblyName" />](<xsl:value-of select="@AssemblyName" />.html)

</xsl:template>

</xsl:stylesheet>
